package com.test.demo.controller;

import com.test.demo.service.DemoService;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;

@RestController
@RequestMapping("/demo")
public class DemoController {

    @Resource
    private DemoService service;


    @GetMapping("/info/{id}")
    @ResponseStatus(HttpStatus.OK)
    public Map<String, Object> findById(@PathVariable("id") Long id) {
        return service.findById(id);
    }
}
